var http = require('http'),
	optfile = require('./optfile');

http.createServer(function (req, res){
	res.writeHead(200, {'Content-Type':'text/html, charset=utf-8'});
	if(req.url != "/favicon.ico"){
		res.write('Hello World');
		function recall(data){//类似闭包
			res.write(data.toString());
			res.end('');
		}
		optfile.readfile("./a.txt",recall);
		// optfile.readFileSync("E:\\Node-test\\laohe\\readfile\\a.txt");
		console.log('主程序执行完毕');
		// res.end('');
	}
}).listen(8000);